package com.accounting.client.remote;

import com.accounting.client.remote.obj.Product;
import com.accounting.client.remote.obj.PurchaseRecord;
import com.accounting.client.remote.obj.Stock;
import com.accounting.client.remote.transfer.AddProductRequest;
import com.accounting.client.remote.transfer.CreatePurchaseRecordRequest;
import com.accounting.client.remote.transfer.DecreaseStocksRequest;
import com.accounting.client.remote.transfer.SearchPurchaseRecordRequest;
import com.accounting.client.remote.transfer.SearchStockRequest;
import com.accounting.client.remote.transfer.TransferPurchaseRecordRequest;
import com.accounting.client.remote.transfer.UpdateProductRequest;
import com.accounting.client.remote.transfer.UpdatePurchaseRecordRequest;
import com.google.gwt.user.client.rpc.AsyncCallback;

import corelib.client.search.PagingRequest;
import corelib.client.search.PagingResult;

public interface ProductServiceAsync {
	
	
	
	
	public void ListProducts(String passport, int catalogId, PagingRequest request, AsyncCallback<PagingResult<Product>> callback);
	public void ListProductsByKeyword(String passport, PagingRequest request, AsyncCallback<PagingResult<Product>> callback);
	public void DeleteProduct(String passport, String productId, AsyncCallback<Boolean> callback);
	public void AddProduct(String passport, AddProductRequest request, AsyncCallback<Boolean> callback);
	public void UpdateProduct(String passport, String productId, UpdateProductRequest request, AsyncCallback<Boolean> callback);
	public void SearchProducts(String passport, PagingRequest request, AsyncCallback<PagingResult<Product>> callback);
	
	public void CreatePurchaseRecord(String passport,  CreatePurchaseRecordRequest request, AsyncCallback<String> callback);
	public void UpdatePurchaseRecord(String passport,  UpdatePurchaseRecordRequest request, AsyncCallback<Boolean> callback);
	public void TransferPurchaseRecord(String passport, TransferPurchaseRecordRequest request, AsyncCallback<String> callback);
	public void DeletePurchaseRecord(String passport,   String recordId, AsyncCallback<Boolean> callback);
	public void ListPurchaseRecords (String passport,  String productId, PagingRequest request, AsyncCallback<PagingResult<PurchaseRecord>> callback);
	public void SearchPurchaseRecords(String passport, SearchPurchaseRecordRequest request, AsyncCallback<PagingResult<PurchaseRecord>> callback);
	
	public void SyncProductStock(String passport, String productId, AsyncCallback<Boolean> callback);
	public void DecreaseStocks(String passport, DecreaseStocksRequest request, AsyncCallback<Boolean> callback);
	public void ListStocks(String passport, PagingRequest request, AsyncCallback<PagingResult<Stock>> callback);
	public void ListStocksByLocation(String passport, int location, PagingRequest request, AsyncCallback<PagingResult<Stock>> callback);
	public void SearchStocks(String passport, SearchStockRequest request, AsyncCallback<PagingResult<Stock>> callback);
	public void SyncStock(String passport, String productId, int location, AsyncCallback<Boolean> callback);
	
}
